package com.missilike.admin.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.missilike.biz.IMilOrderService;
import com.missilike.biz.ISysConfigService;
import com.missilike.core.result.CommonResult;
import com.missilike.core.utils.ResultUtils;
import com.missilike.domain.response.MilOrderInfo;
import com.missilike.domain.response.MilWithdrawRecordInfo;
import com.missilike.repository.entity.SysConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author kin
 * @since 2019-01-08
 */
@RestController
@RequestMapping("/api/mil/order")
public class MilOrderController {

    private final IMilOrderService milOrderService;

    @Autowired
    public MilOrderController(IMilOrderService milOrderService) {
        this.milOrderService = milOrderService;
    }

    @RequestMapping(value = "page", method = RequestMethod.GET)
    public CommonResult list(@RequestParam(value = "pageNum", required = false, defaultValue = "1") int pageNum,
                             @RequestParam(value = "pageSize", required = false, defaultValue = "20") int pageSize,
                             @RequestParam(value = "account", required = false, defaultValue = "") String account) {
        IPage<MilOrderInfo> milWithdrawRecordList = milOrderService.getOrderList(new Page<>(pageNum, pageSize),account);
        return ResultUtils.ok(milWithdrawRecordList);
    }

}

